const path = require('path');
module.exports = {
  entry: './app/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  module: {
    rules: [{
      test: /.jsx?$/,
      include: [
        path.resolve(__dirname, 'app')
      ],
      exclude: [
        path.resolve(__dirname, 'node_modules'),
        path.resolve(__dirname, 'bower_components')
      ],
      loader: 'babel-loader',
      query: {
        presets: ['es2015']
      }
    }]
  },
  resolve: {
    extensions: ['.json', '.js', '.jsx', '.css']
  },
  devtool: 'source-map'
};

// ejs-loader
// var webpack = require('webpack');
// var HtmlWebpackPlugin = require('html-webpack-plugin');
// module.exports = {
// 	entry: './index.js',
// 	output: {
// 		filename: 'bundle.js'
// 	},
// 	module: {
// 		loaders:[ 
// 			{ 
// 				test: /\.tpl$/, 
// 				loader: 'ejs-loader?variable=data'
// 			},
// 		]
// 	}, 
// 	plugins: [
// 		// 
// 		new HtmlWebpackPlugin(),
// 		// 
// 	    new webpack.ProvidePlugin({
// 	        _: "underscore"
// 	    })
// 	]
// };